

package com.hazelcast.aggregation;

import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.DataSerializable;

import java.io.IOException;

public class Person implements DataSerializable {

    public Double age;
    public byte[] overhead;

    public Person() {
    }

    public Person(Double age) {
        this.age = age;
    }

    public Person(Double age, byte[] overhead) {
        this.age = age;
        this.overhead = overhead;
    }

    @Override
    public void writeData(ObjectDataOutput out) throws IOException {
        out.writeDouble(age);
        out.writeByteArray(overhead);
    }

    @Override
    public void readData(ObjectDataInput in) throws IOException {
        age = in.readDouble();
        overhead = in.readByteArray();
    }
}
